package mx.messaging;

extern class MessageAgent extends flash.events.EventDispatcher, implements mx.core.IMXMLObject {
	var authenticated(default,null) : Bool;
	var channelSet : ChannelSet;
	var clientId(default,null) : String;
	var connected(default,null) : Bool;
	var destination : String;
	var id : String;
	var requestTimeout : Int;
	function new() : Void;
	function acknowledge(ackMsg : mx.messaging.messages.AcknowledgeMessage, msg : mx.messaging.messages.IMessage) : Void;
	function channelConnectHandler(event : mx.messaging.events.ChannelEvent) : Void;
	function channelDisconnectHandler(event : mx.messaging.events.ChannelEvent) : Void;
	function channelFaultHandler(event : mx.messaging.events.ChannelFaultEvent) : Void;
	function disconnect() : Void;
	function fault(errMsg : mx.messaging.messages.ErrorMessage, msg : mx.messaging.messages.IMessage) : Void;
	function hasPendingRequestForMessage(msg : mx.messaging.messages.IMessage) : Bool;
	function initialized(document : Dynamic, id : String) : Void;
	function logout() : Void;
	function setCredentials(username : String, password : String, ?charset : String) : Void;
	function setRemoteCredentials(username : String, password : String, ?charset : String) : Void;
	private var _agentType : String;
	private var _credentials : String;
	private var _credentialsCharset : String;
	private var _disconnectBarrier : Bool;
	private var _ignoreFault : Bool;
	private var _log : mx.logging.ILogger;
	private function assertCredentials(value : String) : Void;
	private function flushClientIdWaitQueue() : Void;
	private function initChannelSet(message : mx.messaging.messages.IMessage) : Void;
	private function internalSend(message : mx.messaging.messages.IMessage, ?waitForClientId : Bool) : Void;
	private function reAuthorize(msg : mx.messaging.messages.IMessage) : Void;
	private function setConnected(value : Bool) : Void;
}
